#include <REGX52.H>
#include "Delay.h"
#include "MatrixLED.h"

unsigned char code Animation[]={
//	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
//	0xFF,0x10,0x10,0x10,0x10,0xFF,0x00,0x00,
//	0xFF,0x91,0x91,0x91,0x00,0x00,0xFF,0x01,
//	0x01,0x01,0x01,0x00,0xFF,0x01,0x01,0x01,
//	0x01,0x00,0x7E,0x81,0x81,0x81,0x81,0x7E,
//	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x0E,0x1B,0x7F,0x7F,0x1B,0x0E,0x00,
		0x00,0x04,0x0C,0x18,0x7F,0x7F,0x1B,0x0E,
		0x00,0x08,0x0C,0x05,0x7F,0x7F,0x1E,0x0C,
		0xC0,0x00,0x41,0x22,0x1A,0x7C,0x7D,0x1A,
		0x00,0x60,0x61,0x12,0x0A,0x7E,0x7F,0x08,
		0x00,0x06,0x0E,0x08,0x0B,0x3E,0x3E,0x0B,
		0x00,0x03,0x0B,0x08,0x0B,0x3E,0x3E,0x0B,
		0x00,0x06,0x0E,0x08,0x09,0x3F,0x3E,0x0B,
		0x00,0x0E,0x13,0x7E,0x7E,0x1F,0x0E,0x00,
		0x08,0x13,0x7E,0x7E,0x12,0x1D,0x0C,0x00,
		0x09,0x12,0x7E,0x7F,0x10,0x13,0x03,0x00,
		0x09,0x12,0x7E,0x7F,0x10,0x1C,0x0C,0x00,
		0x00,0x0C,0x15,0x7E,0x7E,0x17,0x0E,0x00,
		0x00,0x30,0x38,0x0D,0x7E,0x7F,0x1D,0x08,
		0xC0,0xC0,0x30,0x1B,0x7C,0x7F,0x08,0x00,
		0x00,0x00,0x37,0xF8,0xFA,0x34,0x00,0x00,
		0x00,0x00,0x1B,0x7C,0x7C,0x1A,0x01,0x00,
		0x00,0x00,0x09,0x1E,0x7C,0x7F,0x18,0x00,
		0x00,0x00,0x1B,0x7C,0x7C,0x1B,0x00,0x00,
		0x00,0x00,0x09,0x1E,0x7C,0x7F,0x18,0x00,
		0x00,0x00,0x1B,0x7C,0x7C,0x1B,0x00,0x00,
		0x08,0x10,0x16,0x7C,0x7F,0x10,0x08,0x00,
		0x00,0x10,0x13,0x7C,0x7E,0x18,0x00,0x00,
		0x00,0x08,0x13,0x7C,0x7F,0x10,0x10,0x00,
		0x00,0x08,0x12,0xFC,0xFD,0x3A,0x00,0x00,
		0x00,0x08,0x12,0xFC,0xFC,0x22,0x10,0x00,
		0x00,0x00,0x61,0x12,0x7C,0x7F,0x10,0x60,
		0x00,0x00,0x20,0x11,0x12,0x7C,0x7E,0x19,
		0x00,0x00,0x00,0x31,0x0A,0x7C,0x7E,0x0D,
		0x00,0x00,0x20,0x11,0x12,0x7C,0x7E,0x19,
		0x00,0x00,0x00,0x31,0x0A,0x7C,0x7E,0x0D,
		0x00,0x00,0x20,0x11,0x12,0x7C,0x7E,0x19,
		0x00,0x00,0x00,0x31,0x0A,0x7C,0x7E,0x0D,
		0x00,0x00,0x20,0x11,0x12,0x7C,0x7E,0x19,
		0x00,0x00,0x00,0x31,0x0A,0x7C,0x7E,0x0D,


};

void main ()
{
	unsigned char i,Offset=0,Count=0;
	MatrixLED_Init();
	
	while(1)
	{
		for(i=0;i<8;i++)
		{
			MatrixLED_ShowColum(i,Animation[i+Offset]);
		}
//		MatrixLED_ShowColum(0,Animation[0]);
//		MatrixLED_ShowColum(1,Animation[1]);
//		MatrixLED_ShowColum(2,Animation[2]);		
//		MatrixLED_ShowColum(3,Animation[3]);
//		MatrixLED_ShowColum(4,Animation[4]);
//		MatrixLED_ShowColum(5,Animation[5]);
//		MatrixLED_ShowColum(6,Animation[6]);
//		MatrixLED_ShowColum(7,Animation[7]);
		Count++;
		if(Count>25)
		{
			Count=0;
			Offset+=8;
			if(Offset>10000)
			{
				Offset=0;
			}
		}

	}
	
}
